package com.swyc.osschat.Test.Redis.jedis;

import redis.clients.jedis.Jedis;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Author: z156940l@outlook.com
 * @Date: 2021/2/18 12:57
 */
public class JedisTestTwo {

    public static void main(String[] args) {

        Jedis jedis = RedisConnect.connect();

        // map
        Map<String, String> user = new HashMap<String, String>();
        user.put("name", "cd");
        user.put("password", "123456");
        // map存入redis
        jedis.hmset("user", user);

        // 取出map
        Map<String, String> user1 = jedis.hgetAll("user");
        System.out.println(user1.toString());
    }
}
